﻿using System;
using System.ComponentModel;
using Loki.Utils;

namespace Loki
{
    internal class TaskStatus : TrackedObject, ITaskStatus
    {
        #region  ID
        private static PropertyChangedEventArgs _IDChangedArgs = ObservableHelper.CreateChangedArgs<TaskStatus>(x => x.ID);

        private static PropertyChangingEventArgs _IDChangingArgs = ObservableHelper.CreateChangingArgs<TaskStatus>(x => x.ID);

        private Guid _ID;

        public Guid ID
        {
            get
            {
                return _ID;
            }

            set
            {
                if (value != _ID)
                {
                    NotifyChanging(_IDChangingArgs);
                    _ID = value;
                    NotifyChanged(_IDChangedArgs);
                }
            }
        }
        #endregion

        #region  Status
        private static PropertyChangedEventArgs _StatusChangedArgs = ObservableHelper.CreateChangedArgs<TaskStatus>(x => x.Status);

        private static PropertyChangingEventArgs _StatusChangingArgs = ObservableHelper.CreateChangingArgs<TaskStatus>(x => x.Status);

        private string _Status;

        public string Status
        {
            get
            {
                return _Status;
            }

            set
            {
                if (value != _Status)
                {
                    NotifyChanging(_StatusChangingArgs);
                    _Status = value;
                    NotifyChanged(_StatusChangedArgs);
                }
            }
        }
        #endregion

        #region  Percentage
        private static PropertyChangedEventArgs _PercentageChangedArgs = ObservableHelper.CreateChangedArgs<TaskStatus>(x => x.Percentage);

        private static PropertyChangingEventArgs _PercentageChangingArgs = ObservableHelper.CreateChangingArgs<TaskStatus>(x => x.Percentage);

        private double _Percentage;

        public double Percentage
        {
            get
            {
                return _Percentage;
            }

            set
            {
                if (value != _Percentage)
                {
                    NotifyChanging(_PercentageChangingArgs);
                    _Percentage = value;
                    NotifyChanged(_PercentageChangedArgs);
                }
            }
        }
        #endregion
    }
}
